package crmdna.list_do_not_use;

import java.util.Set;

import javax.annotation.Nullable;
import javax.inject.Named;

import crmdna.common.APIResponse;
import crmdna.common.APIResponse.Status;

//@Api(name = "listPoC")
public class ListPoCApi {

	//@ApiMethod(path = "create", httpMethod = HttpMethod.POST)
	public APIResponse create(@Nullable @Named("client") String client,
			@Named("groupId") long groupId,
			@Named("displayName") String displayName) {

		try {

			if (client == null)
				client = "isha";

			ListProp listProp = ListCore.create(client, groupId, displayName);

			return new APIResponse(Status.SUCCESS, listProp);

		} catch (Exception ex) {
			return new APIResponse(ex);
		}
	}

	// @ApiMethod(path = "add12000Members", httpMethod = HttpMethod.POST)
	// public APIResponse add12000Members(@Nullable @Named("client") String
	// client,
	// @Named("listId") long listId) {
	//
	// try {
	//
	// if (client == null)
	// client = "isha";
	//
	// //ListProp listProp = ListCore.addElements(client, listId, elements);
	//
	// return new APIResponse(Status.SUCCESS, listProp);
	//
	// } catch (Exception ex) {
	// return new APIResponse(ex);
	// }
	// }

	//@ApiMethod(path = "getMemberIds", httpMethod = HttpMethod.GET)
	public APIResponse getMemberIds(@Nullable @Named("client") String client,
			@Named("listId") long listId) {

		try {

			if (client == null)
				client = "isha";

			Set<Long> memberIds = ListCore.getElements(client, listId);

			return new APIResponse(Status.SUCCESS, memberIds);

		} catch (Exception ex) {
			return new APIResponse(ex);
		}
	}
}
